/*
 * comlan
 */

package com.promfy.timetable.ui;

import com.promfy.timetable.R;

import android.app.Dialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;



public class CustomDialog implements OnClickListener{
	private Context context;
	private LayoutInflater inflater;
	private Dialog dialog;
	private View view;
	private Builder builder;


	public CustomDialog(Context context) {
		super();
		this.context = context;
		initView();
	}

	private void initView() {
		inflater = LayoutInflater.from(context);
		view = inflater.inflate(R.layout.custom_dialog, null);
		dialog =  new Dialog(context, R.style.Transparent3);
		dialog.addContentView(view, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
		dialog.setCancelable(false);
		
	}

	public void showDialog(){
		if(dialog == null) return;
		dialog.show();
	}
	
	public void cancelDialog(){
		if(dialog == null) return;
		dialog.cancel();
	}

	@Override
	public void onClick(View v) {
		int what = v.getId();
		switch(what){
//		case R.id.btn_custom_dialog:
//			cancelDialog();
//			break;
		}
		
	}

	public void setCancelable(boolean b) {
		if(dialog == null) return;
		dialog.setCancelable(b);
		
	}
	

}
